clear; clc; close all
d = dlmread('C:\Users\Mittal\Documents\Work\Code\bsccs\C\codebase\CCD\Release\test-LR.txt',',',[1 1 100000 102]);

fp = fopen('C:\Users\Mittal\Documents\Work\Code\bxr-bayesian-regression\test.txt','w');

for i = 1:size(d,1),
    fprintf(fp,'%d ',d(i,1));
    for j = 3:size(d,2),
        if(d(i,j) ~= 0)
            fprintf(fp,'%d:%f ',j-2,d(i,j));
        end
    end
    fprintf(fp,'\n');
end

fclose(fp);